home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6160 < prev    next >
Encoding:
Text File  |  1996-08-05  |  926 b   |  38 lines

  1. Path: newsfeed.direct.ca!usenet
  2. From: etoivane@direct.ca (Ed Toivanen)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: [Help] I can't find my error.
  5. Date: 22 Feb 1996 23:52:37 GMT
  6. Organization: Your Organization
  7. Message-ID: <4givk5$bqk@aphex.direct.ca>
  8. References: <4ggvgr$1b2@aurora.engr.LaTech.edu>
  9. NNTP-Posting-Host: 204.174.243.36
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-Newsreader: WinVN 0.99.6
  13.  
  14.  
  15. #include <stdio.h>
  16. #include <stdlib.h>
  17.  
  18. #define NAMESIZE 100
  19. #define BUFSIZE  4
  20.  
  21. int main(void)
  22. {
  23.         char buf[BUFSIZE];
  24.         char name[NAMESIZE];      
  25.         int  age, next_age; 
  26.  
  27.         printf("Please enter your name:\t");
  28.         name = fgets(buf, sizeof(buf), stdin);
  29.         printf("\nPlease enter your age:\t");
  30.         age = atoi(fgets(buf, sizeof(buf), stdin));
  31.         next_age += age;
  32.         printf("\nHi, %s ,next year, you will be %d\n", name, next_age);
  33.         
  34.         return(0);
  35. }
  36.  
  37.  
  38.